Called when popup is maximized or minimized.

<div class="definition">
    onToggle = function(event)
</div>

This event is emitted in addition to <span class="argument">onMax</span> or <span class="argument">onMin</span> and can be used
for resizing of the content inside the popup, for example resizing a grid or a layout. Please note that you will need to user
<span class="argument">event.onComplete</span> to trigger the resize when transition is complete.
<div style="height: 10px;"></div>

You can add event listener during the object creation:

<textarea class="javascript">
w2popup.open({
    title    : 'Title',
    body     : 'Body',
    onToggle : function (event) {
        event.onComplete = function () {
            w2ui.grid.resize();
        }
    }        
});
</textarea>

or after popup is opened:

<textarea class="javascript">
w2popup.on('toggle', function(event) {
    console.log('event: ' + event.type, event);
});
</textarea>

The event handler is called before the default action of the event is triggered. You can cancel the default action by calling
<span class="method">event.preventDefault()</span>. To perform an action 
after the event is fully processed, define <span class="method">event.onComplete</span> function. 
<div style="height: 10px;"></div>
See <a href="utils/events">events</a> page in utilities for more details.